home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / lang / amigatalk.lha / intuition / BoopsiFuelGaugeTags.st < prev    next >
Text File  |  2002-05-05  |  3KB  |  77 lines

  1. " --------------------------------------------------------------------- "
  2. " BoopsiFuelGaugeTags Class is a Singleton class that allows the user   "
  3. " to reference BOOPSI FuelGauge class tags' hexadecimal values.         "
  4. ""
  5. "  EXAMPLE:  'myTag <- fuelGaugeTags getTag: #FUELGAUGE_Level'          "
  6. ""
  7. " ALL singleton classes MUST contain the following:                     "
  8. "" 
  9. "  the methods:  isSingleton AND privateSetup     AND                   "
  10. "                 uniqueInstance Class instance variable.               "
  11. " --------------------------------------------------------------------- "
  12.  
  13. Class BoopsiFuelGaugeTags :Dictionary ! uniqueInstance !
  14. [
  15.    isSingleton
  16.      ^ true  
  17. |  
  18.    privateNew ! newinstance !
  19.      newinstance <- super new.
  20.  
  21.      ^ newinstance
  22. |
  23.    new
  24.      ^ self privateSetup
  25. |
  26.    getTag: tagKey
  27.      ^ self at: tagKey
  28. |
  29.    privateInitializeDictionary
  30.  
  31.      self at: #FUELGAUGE_Min         put: 16r85012001. " fuelgauge minimum value. "
  32.  
  33.      self at: #FUELGAUGE_Max         put: 16r85012002. " fuelgauge maximum value. "
  34.  
  35.      self at: #FUELGAUGE_Level       put: 16r85012003. " fuelgauge level (value between min and max). "
  36.  
  37.      self at: #FUELGAUGE_Orientation put: 16r85012004. " orientation mode. "
  38.  
  39.      self at: #FUELGAUGE_Percent     put: 16r85012005. " (BOOL) render numeric percentage display. "
  40.  
  41.      self at: #FUELGAUGE_Ticks       put: 16r85012006. " enable tick marks if # of ticks set is not 0. "
  42.  
  43.      self at: #FUELGAUGE_ShortTicks  put: 16r85012007. " enable small intermediate tick marks. "
  44.  
  45.      self at: #FUELGAUGE_TickSize    put: 16r85012008. " height of  large tick marks. "
  46.  
  47.      self at: #FUELGAUGE_TickPen     put: 16r85012009. " tickmark pen. "
  48.  
  49.      self at: #FUELGAUGE_PercentPen  put: 16r8501200A. " pen # to use for inner rendering. "
  50.  
  51.      self at: #FUELGAUGE_FillPen     put: 16r8501200B. " pen # to use for the fuelbar. "
  52.  
  53.      self at: #FUELGAUGE_EmptyPen    put: 16r8501200C. " fuelgauge background/empty pen number. "
  54.  
  55.      self at: #FUELGAUGE_VarArgs     put: 16r8501200D. " argument array for GA_Text varargs string "
  56.  
  57.      self at: #FUELGAUGE_Justification put: 16r8501200E. " GA_Text justification mode "
  58.  
  59.      " FUELGAUGE_Orientation modes: "
  60.      self at: #FGORIENT_HORIZ put: 0.
  61.      self at: #FGORIENT_VERT  put: 1.
  62.  
  63.      " FUELGAUGE_Justification modes: "
  64.      self at: #FGJ_LEFT          put: 0. " default "
  65.      self at: #FGJ_CENTER     put: 1.
  66.      self at: #FGJ_CENTRE     put: 1. " english/canadian spellings "
  67. |
  68.    privateSetup
  69.      (uniqueInstance isNil)
  70.        ifTrue: [uniqueInstance <- self privateNew.
  71.                 
  72.                 self privateInitializeDictionary.
  73.                ].
  74.                
  75.      ^ self    "or ^ uniqueInstance??"
  76. ]
  77.